package com.vickcan.vdp.domain;

import lombok.Getter;
import lombok.Setter;

import java.util.Arrays;
import java.util.List;

/**
 * @Author: ByteExpress
 * @Date: 2024/8/28 22:35
 * @Version V1.0
 */
@Setter
@Getter
public class VConfig {
    private Compile compile;
    private Deploy deploy;

    @Setter
    @Getter
    public static class Compile {
        private String branch = "test";
    }

    @Setter
    @Getter
    public static class Deploy {
        private String cmd;
        private List<String> cmdList;
        private String uploadPath;
        private String deployPath;

        public List<String> getCmdList() {
            if (null == cmdList && null != cmd) {
                cmdList = Arrays.stream(cmd.split(";")).toList();
            }
            return cmdList;
        }
    }
}
